/*
*
*
*	javascript
*	depend on jquery
*
*
*
*
*
*/
//倒计时
function sendSetTime(ele,opt){
    this.options={
        timeInversors : 60,
        timeContent : '获取动态密码',
        timeSec : 0,
        timeDuration : 1000
    };
    this.element=$(ele);
    if(typeof opt == "object"){
        for(var q in opt){
            this.options[q]=opt[q];
        }
    }
    this.timer(this.options.timeInversors);
}
sendSetTime.prototype={
    timer:function(timeInversors){
        var o = this.options;
        var self = this;
        var timeContent = o.timeContent;
        setTimeout(function(){
            timeInversors = timeInversors - 1;
            timeContent = timeInversors + "秒后可重发";
            if(timeInversors == -1){
                clearTimeout(self.timer);
                self.element.removeClass("btn-disable");
                self.element.removeAttr('disabled');
                self.element.val(o.timeContent);
            }else{
                self.element.val(timeContent);
                self.timer(timeInversors);
            }
        },o.timeDuration);
    }
}

//IE处理placeholder兼容
function ie_placehodler(id)
{

	$("#"+id).focus(function(){
		if($(this).val()==$(this).attr("_placeholder")){

			$(this).val("");
			$(this).css({"color":"#000"});
		}else{
			$(this).css({"color":"#000"});
		}
	});
	$("#"+id).focusout(function(){
		if(!$(this).val()){
			 $(this).val($("#"+id).attr("_placeholder"));
			 $(this).css({"color":"#CDCDCD"});
		}else{
			if($(this).val()==$("#"+id).attr("_placeholder")){
				$(this).css({"color":"#CDCDCD"});
			}else{
				$(this).css({"color":"#000"});
			}
			
		}
	});
	 if($("#"+id).val() && $("#"+id).val()!=$("#"+id).attr("_placeholder")){
		$("#"+id).css({"color":"#000"});
	}else{
		$("#"+id).val($("#"+id).attr("_placeholder"));
		$("#"+id).css({"color":"#CDCDCD"});
	}
}